<template>
  <div class="newpage">
    <div class="newpage_title">
      <div class="nav-left">
        <img class="company-logo" src="../../styles/logo.svg" alt="" />
      </div>
      <div class="nav-center" v-if="viewType == 1 && statusIndex == 2">
        <iconSvg
          name="filter"
          w="20px"
          h="22px"
          @click.native="showSearchPanel = true"
        ></iconSvg>
      </div>
      <div class="nav-center" v-else>
        <!-- <iconSvg name="g6change" w="25" style="color:#fff" @click.native="backToG6page('g6')"></iconSvg> -->
      </div>
      <div class="nav-right">
        <span class="paidan">
          <i class="iconfont icon-paidan" @click="toCreateWorkOrder"></i>
        </span>
        <span class="nav_border_left"></span>
        <iconSvg
          name="home"
          w="20px"
          h="22px"
          class="right_icon"
          @click.native="backToHomepage"
        ></iconSvg>
      </div>
    </div>
    <Application></Application>
    <div :class="showSearchPanel ? 'search-panel show' : 'search-panel hide'">
      <div class="search-item">
        <span>上报时间</span>
        <datetime
          style="color: #FFF"
          v-model="searchForm.createTime"
          placeholder="选择上报日期"
          clear-text="清除"
          @on-clear="clearDate"
        ></datetime>
      </div>
      <div class="search-item">
        <span>工单状态</span>
        <select class="iu-select" id="status-option" @change="chooseStatus">
          <option
            v-for="item in statusOptions"
            :value="item.value"
            :key="item.value"
          >
            {{ item.label }}
          </option>
        </select>
      </div>
      <div class="operation-item">
        <div class="operation-btn" @click="close">取消</div>
        <div class="operation-btn primary" @click="confirmSearch">确认</div>
      </div>
    </div>
    <div class="newpage_work">
      <div class="newpage_work_top top_tab">
        <div
          class="newpage_work_title"
          :class="viewType == 1 ? 'tab_active' : ''"
          @click="switchTopTab(1)"
        >
          我的工单
        </div>
        <div
          class="newpage_work_title"
          :class="viewType == 2 ? 'tab_active' : ''"
          @click="switchTopTab(2)"
        >
          管理区域
        </div>
      </div>
      <div class="department_box" v-if="viewType == 2">
        <div
          class="department_select"
          :class="showTree ? 'active' : ''"
          @click="showTreeFn(true)"
        >
          <p class="department_name">{{ curDepartment.departmentName }}</p>
          <iconSvg
            name="downFill"
            w="23px"
            height="13px"
            class="selece_icon"
            ref="selece_icon"
          ></iconSvg>
        </div>
        <transition name="slide">
          <div class="dep_box" v-show="showTree">
            <dep-tree
              @changeId="change"
              @showTreeFn="showTreeFn"
              @initCurDepartment="updateCache"
              :initDepartment="curDepartment"
            ></dep-tree>
          </div>
        </transition>
      </div>
      <div class="newpage_mana" v-show="viewType == 2">
        <div class="newpage_mana_Chart">
          <!-- <chart-list :chart-list="chartList" :show-title="false"></chart-list> -->
          <div id="myChart"></div>
          <div class="chart_empty" v-if="show_chart_empty">
            <img src="/static/img/chart_empty.png" />
            <p>暂无相关数据</p>
          </div>
        </div>
      </div>
      <div class="newpage_work_bottom">
        <div class="newpage_work_nav">
          <div class="newpage_work_tab">
            <tab
              style="z-index:0"
              active-color="#456de6"
              default-color="#fff"
              custom-bar-width="80%"
            >
              <tab-item
                @on-item-click="handler(1)"
                :selected="statusIndex == 1"
              >
                <div class="tab-item">
                  <span>
                    {{ unhandledTotal }}
                  </span>
                  <span>
                    未处理
                  </span>
                </div>
              </tab-item>
              <tab-item
                @on-item-click="handler(3)"
                :selected="statusIndex == 3"
              >
                <div class="tab-item">
                  <span>
                    {{ delayDataTotal }}
                  </span>
                  <span>
                    推迟处理
                  </span>
                </div>
              </tab-item>
              <tab-item
                @on-item-click="handler(4)"
                :selected="statusIndex == 4"
              >
                <div class="tab-item">
                  <span>
                    {{ handledDataTotal }}
                  </span>
                  <span>
                    已关闭
                  </span>
                </div>
              </tab-item>
              <tab-item
                v-if="viewType == 1"
                :selected="statusIndex == 2"
                @on-item-click="handler(2)"
              >
                <div class="tab-item">
                  <span>
                    {{ dealDataTotal }}
                  </span>
                  <span>
                    我提交的
                  </span>
                </div>
              </tab-item>
            </tab>
          </div>
        </div>
        <div class="newpage_work_conent">
          <iu-card
            class="sheet-card"
            v-for="(item, index) in workSheetList"
            :key="index"
            @click.native="workSheetDetail(item.id)"
          >
            <template #title>
              <div class="sheet-card-title">
                {{ item.sn }}
              </div>
            </template>
            <template #tip>
              <div class="sheet-card-tip" :class="'status' + item.status">
                <span>
                  {{ statusText[+item.status] }}
                </span>
              </div>
            </template>
            <template #body>
              <div class="sheet-card-info">
                <span> {{ sheetTypeText[item.type] }}工单 </span>
                <span
                  class="sheet-card-tag"
                  :class="'priority' + item.priority"
                >
                  {{ sheetPriorityText[item.priority] }}
                </span>
              </div>
              <div class="sheet-card-body">
                描&nbsp;&nbsp;述：{{ item.description }}
              </div>
              <div class="sheet-card-bottom">
                <span>
                  {{ item.operatorName }}
                </span>
                <span>
                  {{ item.createTime | formatDate }}
                </span>
              </div>
            </template>
          </iu-card>
          <div class="not-content" v-if="!workSheetList.length">
            <img src="/static/img/zwlr-icon.png" />
            <div class="title">暂无数据</div>
          </div>
          <!-- <div class="newpage_work_more" v-if="outtimeDatal.length>10" @click="pending(1,1,0)">查看更多</div> -->
          <div class="newpage_work_more" v-if="showMore" @click="getMore">
            查看更多
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { Tab, TabItem, Toast, InlineLoading, Datetime } from "vux";
import iuCard from "@/components/common/card/index";
import depTree from "@/components/common/tree";
import Common from "@/config/commom";
import WorkSheetDao from "@/daos/work_sheet_dao";
import { mapGetters } from "vuex";
import ChartList from "@/components/common/chart_list/index";
import DataAnalysisDao from "@/daos/data_analysis_dao";
import Application from "@/components/common/application";
var _this = null;
export default {
  components: {
    Tab,
    TabItem,
    Toast,
    InlineLoading,
    depTree,
    iuCard,
    ChartList,
    Application,
    Datetime
  },
  data() {
    return {
      viewType: 2, // 我的工单 && 管理区域
      user: null,
      statusIndex: 1, // 工单个状态tab页
      showMore: false,
      amountData: [],
      amountDataComplete: [],
      monthData: [],
      chartList: [],
      total: "",
      secondTotal: "",
      serviceData: "",
      personalData: "",
      serviceoutData: "",
      personaloutData: "",
      workSheetList: [],
      outtimeDatal: [],
      dealData: [],
      delayData: [],
      handledData: [],
      companyName: "",
      showPositionValue: false,
      position: "middle",
      userActionMap: {},
      show_chart_empty: false,
      delayTotal: "",
      delayByUser: "",
      dealDataTotal: 0,
      unhandledTotal: 0,
      delayDataTotal: 0,
      handledDataTotal: 0,
      workSheetList: [],
      pageSize: 10,
      curPage: 1,
      departmentId: null,
      priority: [
        {
          label: "一般",
          value: 1
        },
        {
          label: "重要",
          value: 2
        },
        {
          label: "紧急",
          value: 3
        }
      ],
      sheetTypeText: ["", "点巡检", "更换", "提醒", "维修", "预警"],
      sheetPriorityText: ["", "一般", "重要", "紧急"],
      statusText: [
        "",
        "疑似重复",
        "",
        "",
        "",
        "未处理",
        "",
        "推迟处理",
        "",
        "已解决",
        "",
        "已关闭"
      ],
      statusOptions: [
        { label: "全部", value: null },
        { label: "疑似重复", value: 1 },
        { label: "未处理", value: 5 },
        { label: "推迟处理", value: 7 },
        { label: "已解决", value: 9 },
        { label: "已关闭", value: 11 }
      ],
      curDepartment: {
        id: "",
        departmentName: ""
      },
      searchForm: {
        createTime: null,
        status: null
      },
      showTree: false,
      showSearchPanel: false
    };
  },
  filters: {
    //设备类型过滤
    formatPriority(val) {
      let name = "";
      _this.priority.forEach(item => {
        if (item.value == val) {
          name = item.label;
        }
      });
      return name;
    }
  },
  created() {
    _this = this;
    // 初始化Tab页
    this.user = JSON.parse(localStorage.getItem("user"));
    let filterCache = Common.getFilterCache();
    if (filterCache) {
      if (filterCache.curDepartmentInWSHomePage) {
        this.curDepartment = filterCache.curDepartmentInWSHomePage;
      }
      if (filterCache.curWSPageIndex) {
        this.viewType = filterCache.curWSPageIndex;
      }
    }
    if (this.$route.query.viewType) {
      this.viewType = +this.$route.query.viewType || 1;
    }
    //初始化查询条件
    let now = new Date();
    // this.searchForm.createTime = now.Format("yyyy-MM-dd");
  },
  //返回首页的公共方法
  inject: ["backToHomepage",'backToG6page'],
  computed: {
    ...mapGetters(["getWorkSheetSatatusNum", "getWorkSheetHandleTypeNum"])
  },
  mounted() {
    this.init();
  },
  methods: {
    clearDate: function() {
      this.searchForm.createTime = null;
    },
    confirmSearch: function() {
      this.handler(2, true);
      this.showSearchPanel = false;
    },
    toCreateWorkOrder: function() {
      this.$router.push({
        path: "/sellWorkOrder"
      });
    },
    close: function() {
      this.showSearchPanel = false;
    },
    change(id, departmentName) {
      this.curDepartment.id = id;
      this.curDepartment.departmentName = departmentName;
      //更新缓存
      this.updateCache(id, departmentName);
      this.reloadData(2);
    },
    getChartConfig() {
      let params = {
        code: "GD01",
        departmentId: this.curDepartment.id
      };
      DataAnalysisDao.getChartConfig(params, res => {
        this.chartList.splice(0);
        if (res && res.length) {
          this.chartList = res.map(e => {
            e.show = 0;
            return e;
          });
        }
      });
    },
    showTreeFn(status) {
      if (status) {
        this.$refs.selece_icon.$el.style.transform = "rotate(-180deg)";
      } else {
        this.$refs.selece_icon.$el.style.transform = "rotate(0deg)";
      }
      this.showTree = status;
    },
    updateCache(id, departmentName) {
      let filterCache = Common.getFilterCache();
      if (filterCache && !filterCache.curDepartmentInWSHomePage) {
        this.curDepartment = {
          departmentName,
          id
        };
        filterCache.curDepartmentInWSHomePage = this.curDepartment;
        Common.saveFilterObj(filterCache);
      }
      this.curDepartment = {
        departmentName,
        id
      };
    },
    init() {
      if (this.viewType == 1) {
        this.initMyWorkSheet();
      } else {
        this.initMyManagement();
      }
    },
    initMyWorkSheet() {
      this.$http(this.$API.getUserInfo, {}).then(res => {
        this.companyName = res.org.orgName;
        this.$store.commit("saveUser", res);
        this.user = res;
        //未处理
        this.getUnhandledWorkSheet(1, false);
        // 已解决
        this.getHandledWorkSheet(1, true);
        // 推迟处理
        this.getDelayWorkSheet(1, true);
        // 我提交
        this.getMyWorkSheet(1, true);
      });
    },
    initMyManagement() {
      this.initChart();
      // this.getChartConfig()
      this.getUnhandledForServiceArea(1, false);
      this.getHandledForServiceArea(1, true);
      this.getDelayedForServiceArea(1, true);
    },
    /*
     * index 1.个人；2.查服务区域下的 ，filterParams 状态3
     * key 1 待处理， 2历史
     * overTime:0.不限；1.未超时；2.已超时；3.已处理；4.推迟处理
     */

    pending(index, key, overTime) {
      console.log(index, key, overTime);
      this.$router.push({
        name: "historyWorkOrder",
        query: {
          range: index,
          type: key,
          overTime: overTime
        }
      });
    },
    getMore() {
      this.curPage = this.curPage + 1;
      this.switchStatusTab(this.curPage);
    },
    switchStatusTab: function(pageNum) {
      switch (this.statusIndex) {
        case 1: //未处理
          this.viewType == 1
            ? this.getUnhandledWorkSheet(pageNum, false)
            : this.getUnhandledForServiceArea(pageNum, false);
          break;
        case 2: // 我提交的
          this.getMyWorkSheet(pageNum, false);
          break;
        case 3: //推迟处理
          this.viewType == 1
            ? this.getDelayWorkSheet(pageNum, false)
            : this.getDelayedForServiceArea(pageNum, false);
          break;
        case 4: //已解决
          this.viewType == 1
            ? this.getHandledWorkSheet(pageNum, false)
            : this.getHandledForServiceArea(pageNum, false);
          break;
        default:
      }
    },
    updateWorkSheetList(pageNum, data) {
      if (pageNum == 1) {
        this.workSheetList = [];
      }
      this.workSheetList = this.workSheetList.concat(data.content);
      this.showMore = data.totalElements > this.pageSize * pageNum;
    },
    //我的工单
    getUnhandledWorkSheet(pageNum, recordSizeOnly) {
      this.getWorkSheetAPI(
        1,
        this.getWorkSheetSatatusNum.wcl,
        pageNum,
        recordSizeOnly
      );
    },
    getMyWorkSheet(pageNum, recordSizeOnly) {
      WorkSheetDao.getWorkSheetQueryUserSubmit(
        {
          createTime: this.searchForm.createTime,
          status: this.searchForm.status,
          pageNum: pageNum,
          pageSize: this.pageSize
        },
        res => {
          if (!recordSizeOnly) {
            this.updateWorkSheetList(pageNum, res);
          }
          this.dealDataTotal = res.totalElements;
        }
      );
    },
    getHandledWorkSheet(pageNum, recordSizeOnly) {
      this.getWorkSheetAPI(
        1,
        this.getWorkSheetSatatusNum.ygb,
        pageNum,
        recordSizeOnly
      );
    },
    getDelayWorkSheet(pageNum, recordSizeOnly) {
      this.getWorkSheetAPI(
        1,
        this.getWorkSheetSatatusNum.tccl,
        pageNum,
        recordSizeOnly
      );
    },

    //管理区域
    getUnhandledForServiceArea(pageNum, recordSizeOnly) {
      this.getWorkSheetAPI(
        2,
        this.getWorkSheetSatatusNum.wcl,
        pageNum,
        recordSizeOnly
      );
    },
    getHandledForServiceArea(pageNum, recordSizeOnly) {
      this.getWorkSheetAPI(
        2,
        this.getWorkSheetSatatusNum.ygb,
        pageNum,
        recordSizeOnly
      );
    },
    getDelayedForServiceArea(pageNum, recordSizeOnly) {
      this.getWorkSheetAPI(
        2,
        this.getWorkSheetSatatusNum.tccl,
        pageNum,
        recordSizeOnly
      );
    },
    getWorkSheetAPI: function(range, status, pageNum, recordSizeOnly) {
      let statusList = [];
      if (status == this.getWorkSheetSatatusNum.wcl) {
        statusList.push(
          this.getWorkSheetSatatusNum.wcl,
          this.getWorkSheetSatatusNum.yjj
        );
      } else if (status == this.getWorkSheetSatatusNum.tccl) {
        statusList.push(this.getWorkSheetSatatusNum.tccl);
      } else if (status == this.getWorkSheetSatatusNum.ygb) {
        statusList.push(this.getWorkSheetSatatusNum.ygb);
      }
      let params = {
        pageNum: pageNum,
        pageSize: this.pageSize,
        departmentId:
          this.viewType == 1 ? this.user.department.id : this.curDepartment.id,
        // type: this.type,
        // priority:this.priority,
        status: status, //超时参数（只能单选）：0.不限；1.未超时；2.已超时；3.已处理；4.推迟处理
        statusList,
        range: range //1.个人；2.查服务区域下的
      };
      if (range === 2) {
        WorkSheetDao.getWorkSheetQueryUserArea(params, res => {
          this.updateWorkSheetNum(pageNum, res, status, recordSizeOnly);
        });
      } else {
        WorkSheetDao.getWorkSheetQueryUserLeader(params, res => {
          this.updateWorkSheetNum(pageNum, res, status, recordSizeOnly);
        });
      }
    },
    updateWorkSheetNum(pageNum, res, status, recordSizeOnly) {
      if (!recordSizeOnly) {
        this.updateWorkSheetList(pageNum, res);
      }
      console.log(res);
      if (status == this.getWorkSheetSatatusNum.wcl) {
        this.unhandledTotal = res.totalElements;
      } else if (status == this.getWorkSheetSatatusNum.ygb) {
        this.handledDataTotal = res.totalElements;
      } else if (status == this.getWorkSheetSatatusNum.tccl) {
        this.delayDataTotal = res.totalElements;
      }
    },
    coming() {
      this.showPositionValue = true;
    },
    handler(index, forceUpdate) {
      if (index == this.statusIndex && !forceUpdate) {
        return;
      }
      this.statusIndex = index;
      //重置页面计数器
      this.curPage = 1;
      //判断是否加载更多
      this.switchStatusTab(this.curPage);
    },
    workSheetDetail(id) {
      this.$router.push({
        name: "workOrderDetails",
        query: {
          id
        }
      });
    },
    drawChart: function() {
      let myChart = this.$echarts.init(document.getElementById("myChart"));
      myChart.setOption({
        legend: {
          itemGap: 10,
          itemWidth: 8,
          itemHeight: 8,
          textStyle: {
            color: "#fff",
            fontSize: "10px"
          },
          left: "center",
          bottom: "bottom",
          data: ["当日总量", "当日完成量"]
        },
        color: "#3398DB",
        tooltip: {
          trigger: "axis",
          axisPointer: {
            // 坐标轴指示器，坐标轴触发有效
            type: "shadow" // 默认为直线，可选为：'line' | 'shadow'
          }
        },
        grid: {
          top: "5%",
          left: "3%",
          right: "4%",
          bottom: "16%",
          containLabel: true
        },
        xAxis: [
          {
            type: "category",
            data: this.monthData,
            axisTick: {
              //y轴刻度线
              show: false
            },
            splitLine: {
              //网格线
              show: false
            },
            axisLabel: {
              interval: 0,
              textStyle: {
                color: "#fff"
              }
            },
            axisLine: {
              lineStyle: {
                color: "#a7a7b2",
                width: 2 //
              }
            }
          }
        ],
        yAxis: {
          type: "value",
          /* minInterval: 1, */
          splitLine: { show: false },

          axisTick: {
            //y轴刻度线
            show: false
          },
          splitLine: {
            //网格线
            show: false
          },
          axisLabel: {
            textStyle: {
              color: "#fff"
            }
          },
          axisLine: {
            lineStyle: {
              color: "#a7a7b2"
            }
          }
        },
        series: [
          {
            name: "当日总量",
            type: "bar",
            barWidth: 6,
            itemStyle: {
              normal: {
                color: "#456DE6"
              }
            },
            data: this.amountData
          },
          {
            name: "当日完成量",
            type: "bar",
            barWidth: 6,
            itemStyle: {
              normal: {
                color: "#CD8E79"
              }
            },
            data: this.amountDataComplete
          }
        ]
      });
    },
    switchTopTab(index) {
      if (this.viewType == index) {
        return;
      }
      this.viewType = index;
      this.reloadData(index);
      //缓存视图
      let filterCache = Common.getFilterCache();
      if (filterCache) {
        filterCache.curWSPageIndex = this.viewType;
        Common.saveFilterObj(filterCache);
      }
    },
    reloadData: function(index) {
      this.curPage = 1;
      this.statusIndex = 1;
      console.log(index);
      if (index == 2) {
        // 管理区域
        this.initMyManagement();
      } else {
        //我的工单
        this.initMyWorkSheet();
      }
    },
    initChart() {
      this.amountData = [];
      this.amountDataComplete = [];
      this.monthData = [];
      WorkSheetDao.getWorkSheetServiceAreaGraph(
        {
          departmentId: this.curDepartment.id
        },
        res => {
          for (var i = 0; i < res.length; i++) {
            this.amountData.push(res[i]["count"]);
            this.amountDataComplete.push(res[i]["completeCount"]);
            this.monthData.push(res[i]["date"]);
          }
          let isEmpty = this.amountData.every(item => {
            return item == 0;
          });
          if (isEmpty) {
            this.show_chart_empty = true;
          } else {
            this.show_chart_empty = false;
          }
          this.drawChart();
        }
      );
    },
    chooseStatus() {
      let val = document.getElementById("status-option").value;
      this.searchForm.status = val;
    }
  }
};
</script>
<style lang="less">
.newpage_work_bottom {
  &.vux-tab-wrap {
    padding-top: 50px !important;
  }
  .vux-tab-container {
    height: 50px !important;
  }
  .vux-tab {
    height: 50px !important;
    background: #292a4d !important;
    .vux-tab-item {
      background: none;
      color: #fff;
    }
  }

  .tab-item {
    display: flex;
    flex-direction: column;
    line-height: 1;

    span {
      margin-top: 5px;
      &:nth-child(1) {
        font-size: 16px;
      }
    }
  }
}
#app,
.content {
  height: 100%;
}
</style>
<style lang="less" scoped>
.department_box {
  // position: fixed;
  // width: 100%;
  z-index: 8;
  padding-top: 20px;
  display: flex;
  padding: 0 16px;
  justify-content: space-between;
  position: relative;
  height: 28px;
  .department_select {
    position: relative;
    width: 140px;
    border-radius: 2px;
    background: #292a4d;
    transition: background 0.3s ease-in-out;
    &.active {
      background: #383a69;
    }
    .department_name {
      padding: 5px 9px;
      padding-right: 30px;
      color: #fff;
      font-size: 12px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .selece_icon {
      position: absolute;
      top: 50%;
      right: 8px;
      margin-top: -6px;
      transition: transform 0.3s ease-in-out;
      transform-origin: 50% 50%;
    }
  }
  .dep_box {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: -255px;
    padding-right: 16px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    height: 250px;
    overflow-y: scroll;
    z-index: 9999999;
    -webkit-overflow-scrolling: touch;
  }
}

.top_tab {
  display: flex;
  justify-content: space-around;
  margin-bottom: 20px;
}

.report_time {
  font-size: 12px;
  color: #ffffff59;
}
.newpage {
  min-height: 100vh;
  height: auto;
  background: #1b1c32;
  overflow-y: scroll;
}
.none_conent {
  text-align: center;
  color: gray;
  /* height:30px;
    line-height:30px; */
  border-bottom: none !important;
}
.newpage_work_more {
  height: 40px;
  font-size: 12px;
  line-height: 40px;
  text-align: center;
  color: #456de6;
}
.newpage_work_nav {
  // border-bottom:2px solid #242a50;
  height: 50px;
}
.newpage_work_tab {
  // padding: 0 15px;
}
.newpage_work_second {
  color: #456de6;
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}
.newpage_work_ul {
  display: flex;
  justify-content: space-between;
}
.newpage_work_span {
  font-size: 12px;
  color: #456de6;
}
.urgent-priority {
  color: red;
}
.vital-priority {
  color: #d98806;
}
.newpage_work_li {
  font-size: 12px;
  flex-grow: 2;
  span {
    display: inline-block;
    &:nth-child(1) {
      height: 18px;
      text-align: center;
      line-height: 18px;
      // background:#456de6;
      margin-right: 9px;
    }
    &:nth-child(2) {
      width: 80%;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      vertical-align: middle;
    }
  }
}
.newpage_work_conent {
  color: #fff;
  background: #1b1c32;
  padding: 8px 16px;
  ul {
    padding: 0 15px;
    li {
      &:nth-last-child {
        border-bottom: none !important;
      }
      padding: 12px 0;
      border-bottom: 1px solid #8d8e99;
    }
  }
  .not-content {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    img {
      width: 64px;
      height: 64px;
      margin-left: 20px;
    }
    .title {
      margin: 8px auto;
      width: 126px;
      height: 40px;
      font-size: 14px;
      font-family: PingFangSC-Regular, PingFang SC;
      font-weight: 400;
      color: rgba(158, 198, 251, 1);
      line-height: 20px;
      text-align: center;
    }
  }
}

.sheet-card {
  margin-bottom: 16px;
  .sheet-card-title {
    color: #fff;
    &.warning {
      color: #ffb62c;
    }
    &.error {
      color: #ff2c2c;
    }
  }
  .sheet-card-tip {
    display: flex;
    justify-content: flex-end;
    margin-right: -8px;
    span {
      padding: 2px 6px 4px;
      text-align: right;
      background-color: #292a4d;
      border-radius: 5px;
    }
    &.status1 {
      color: #f56c6c;
    }
    &.status3 {
      color: #409eff;
    }
    &.status5 {
      color: #409eff;
    }
    &.status9 {
      color: #dd9710;
    }
  }
  .sheet-card-info {
    display: flex;
    align-items: center;
    margin: 4px 0 12px;
    .sheet-card-tag {
      margin-left: 12px;
      border: 1px solid #456de6;
      padding: 0 4px 1px;
      font-size: 12px;
      border-radius: 4px;
      color: #456de6;
      &.priority2 {
        color: #d98806;
        border-color: #d98806;
      }
      &.priority3 {
        color: #f66;
        border-color: #f66;
      }
    }
  }
  .sheet-card-body {
    margin: 4px 0 12px;
  }
  .sheet-card-department {
    margin: 8px 0;
    color: rgba(255, 255, 255, 0.8);
  }
  .sheet-card-bottom {
    display: flex;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.6);
  }
}
.newpage_work_bottom {
  // background: #1b1c32;
}
.newpage_work {
  .newpage_work_top {
    // background: #22233f;
    padding: 0 15px;
    .newpage_work_title {
      font-size: 18px;
      color: #fff;
      padding: 10px 0;
      text-align: center;
    }

    .newpage_work_title.tab_active {
      color: rgb(69, 109, 230);
      border-bottom: 1px solid rgb(69, 109, 230);
    }
    .newpage_work_operating {
      padding: 5px 0 8px 0;
      color: #fff;
      font-size: 12px;
      display: flex;
      justify-content: space-between;
      div {
        li {
          &:nth-child(2) {
            position: relative;
            bottom: 3px;
          }
          &:nth-child(1) {
            position: relative;
            top: 3px;
          }
        }
        &:nth-child(2) {
          li {
            &:nth-child(2) {
              &.warn_active {
                color: #d98806;
              }
            }
          }
        }
        display: inline-block;
        width: 23%;
        height: 55px;
        border: 1px solid #456de6;
        border-radius: 8%;
        text-align: center;
        line-height: 27.5px;
      }
    }
  }
  .newpage_mana {
    padding: 0 15px;
    border-bottom: 5px solid #1b1c32;
    .newpage_mana_title {
      text-align: center;
      font-size: 18px;
      color: #1a1a1a;
      padding: 20px 0;
      color: #fff;
    }
    .newpage_mana_Chart {
      position: relative;
      width: 100%;
      height: 160px;
      #myChart {
        width: 100%;
        height: 100%;
      }
      .chart_empty {
        position: absolute;
        display: block;
        width: 84px;
        top: 27%;
        left: 50%;
        transform: translate(-50%, -50%);
        img {
          width: 100%;
        }
        p {
          text-align: center;
          color: #9ec6fb;
          font-size: 13px;
        }
      }
      #myChart > div:first-child {
        width: 100% !important;
        height: 100% !important;
      }
      #myChart > div:first-child > canvas {
        width: 100% !important;
        height: 100% !important;
      }
    }
    .newpage_mana_operating {
      padding: 5px 0 10px 0;
      color: #fff;
      font-size: 12px;
      display: flex;
      justify-content: space-between;
      div {
        li {
          &:nth-child(2) {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            position: relative;
            bottom: 3px;
          }
          &:nth-child(1) {
            position: relative;
            top: 3px;
          }
        }
        &:nth-child(2) {
          li {
            &:nth-child(2) {
              &.warn_active {
                color: #d98806;
              }
            }
          }
        }
        display: inline-block;
        width: 23%;
        height: 55px;
        border: 1px solid #456de6;
        border-radius: 8%;
        text-align: center;
        line-height: 27.5px;
      }
    }
  }
}
.newpage_title {
  height: 44px;
  background: #18182c;
  padding: 0 15px;
  display: flex;
  span {
    display: inline-block;
    color: #ffff;
    font-size: 15px;
    vertical-align: middle;
  }
  .nav-left {
    .company-logo {
      height: 100%;
      width: 48px;
    }
  }
  .nav-center {
    flex: 1;
    display: flex;
    justify-content: center;
  }
  .nav-right {
    // margin-top:12px;
    width: 70px;
    height: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .paidan {
      margin-top: 4px;
      i {
        font-size: 26px;
      }
    }
  }
  .nav_border_left {
    border-left: 2px solid #fff;
    height: 16px;
  }
}
.search-panel {
  background: #22233f;
  position: fixed;
  z-index: 1000;
  height: calc(~"100% - 50px");
  overflow: scroll;
  top: 50px;
  right: 0;
  left: 0;
  bottom: 0;
  // padding-bottom: 45px;
  transition: transform 0.3s ease-in-out;
  transform: translateY(-120%);
  &.show {
    transform: translateY(0);
  }
  &.hide {
    transform: translateY(-120%);
  }
  .weui-grids:before,
  .weui-grid:after {
    border: none;
  }
  .weui-grid:active {
    background: none !important;
  }
  .weui-grid {
    padding: 0 !important;
  }
  div {
    font-size: 18px;
    line-height: 40px;
    color: #fff;
  }
  .search-panel {
    padding: 0 16px;
    height: 100%;
    overflow-y: auto;
  }
  .search-item {
    margin-top: 15px;
    height: 36px;
    font-size: 18px;
    color: #fff;
    padding: 30px 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .iu-select {
      height: 36px;
      width: 70%;
      padding: 2px 4px;
      border: none;
      outline: none;
      border: 1px solid rgba(69, 109, 230, 1);
      border-radius: 2px;
      font-size: 16px;
      color: #456de6;
      background: transparent;
      option {
        background: rgba(255, 255, 255, 0.9);
      }
    }
  }
  .operation-item {
    position: fixed;
    top: 85%;
    width: 100%;
    display: flex;
    justify-content: space-around;
    .operation-btn {
      border: 1px solid #3967dc;
      width: 120px;
      text-align: center;
      color: #3967dc;
    }
    .operation-btn.primary {
      background-color: #3967dc;
      color: #fff;
    }
  }
}
</style>
